<%--                                                                       --%>
<%-- Copyright (c) 2001-2004 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>

<script language="JavaScript">

  function getFilePickerTimeStamp() {
    var now = new Date;
    var timestamp = '' + now.getYear() + now.getMonth() + now.getDate() + 
      now.getHours() + now.getMinutes() + now.getSeconds() + now.getMilliseconds();
    return timestamp;
  }
  
  // popupUrl, required.  Need to include 'selectedContext' parameter for root directory
  // callback, required. Required by javascript syntax, make sure the callback function name 
  // start with alphabetic, not numric, character

  function filePickerPopup(popupUrl, callback, folderFilter, fileFilter, headerKey, headerBundle) {
    if (popupUrl != null) {
      if (popupUrl.indexOf("?") < 0) {
        popupUrl += "?";
      } 
      else {
        popupUrl += "&";
      }
    }
    var timestamp = getFilePickerTimeStamp();
    popupUrl += 'timestamp=' + timestamp + '&callback=' + callback + '&folderFilter=' + folderFilter + '&fileFilter=' + fileFilter;
    popupUrl += '&headerKey=' + headerKey + '&headerBundle=' + headerBundle;
    var windowFeatures = 'width=800,height=600,scrollbars=yes,resizable=yes';
    var windowName = 'filePickerPopup' + callback;
    var popupWindow = window.open(popupUrl, windowName, windowFeatures);
    if (popupWindow != null) {
      if (popupWindow.opener == null) {
        popupWindow.opener = self;
      }
    }
    popupWindow.focus();
  }

</script>

